;;;; -*- mode: Scheme; -*-
(define (sdl-net-library-init . l)
  (load-shared-object
   (if (null? l)
       (case (machine-type)
	 ((i3nt  ti3nt  a6nt  ta6nt)  "SDL2_net.dll")
	 ((i3le  ti3le  a6le  ta6le)  "SDL2_net.so")
	 ((i3osx ti3osx a6osx ta6osx) "SDL2_net.dylib"))
       (car l)))
  )

(define sdl-net-linked-version SDLNet_Linked_Version)
(define sdl-net-init SDLNet_Init)
(define sdl-net-quit SDLNet_Quit)
(define sdl-net-resolve-host SDLNet_ResolveHost)
(define sdl-net-resolve-ip SDLNet_ResolveIP)
(define sdl-net-get-local-addresses
  SDLNet_GetLocalAddresses)
(define sdl-net-tcp-open SDLNet_TCP_Open)
(define sdl-net-tcp-accept SDLNet_TCP_Accept)
(define sdl-net-tcp-get-peer-address
  SDLNet_TCP_GetPeerAddress)
(define sdl-net-tcp-send SDLNet_TCP_Send)
(define sdl-net-tcp-recv SDLNet_TCP_Recv)
(define sdl-net-tcp-close SDLNet_TCP_Close)
(define sdl-net-alloc-packet SDLNet_AllocPacket)
(define sdl-net-resize-packet SDLNet_ResizePacket)
(define sdl-net-free-packet SDLNet_FreePacket)
(define sdl-net-alloc-packetv SDLNet_AllocPacketV)
(define sdl-net-free-packetv SDLNet_FreePacketV)
(define sdl-net-udp-open SDLNet_UDP_Open)
(define sdl-net-udp-set-packet-loss
  SDLNet_UDP_SetPacketLoss)
(define sdl-net-udp-bind SDLNet_UDP_Bind)
(define sdl-net-udp-unbind SDLNet_UDP_Unbind)
(define sdl-net-udp-get-peer-address
  SDLNet_UDP_GetPeerAddress)
(define sdl-net-udp-sendv SDLNet_UDP_SendV)
(define sdl-net-udp-send SDLNet_UDP_Send)
(define sdl-net-udp-recvv SDLNet_UDP_RecvV)
(define sdl-net-udp-recv SDLNet_UDP_Recv)
(define sdl-net-udp-close SDLNet_UDP_Close)
(define sdl-net-alloc-socket-set SDLNet_AllocSocketSet)
(define sdl-net-add-socket SDLNet_AddSocket)
(define sdl-net-tcp-add-socket SDLNet_TCP_AddSocket)
(define sdl-net-udp-add-socket SDLNet_UDP_AddSocket)
(define sdl-net-del-socket SDLNet_DelSocket)
(define sdl-net-tcp-del-socket SDLNet_TCP_DelSocket)
(define sdl-net-udp-del-socket SDLNet_UDP_DelSocket)
(define sdl-net-check-sockets SDLNet_CheckSockets)
(define sdl-net-free-socket-set SDLNet_FreeSocketSet)
(define sdl-net-set-error SDLNet_SetError)
(define sdl-net-get-error SDLNet_GetError)
